package com.herr.processor;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author herr05
 */
@Configuration
public class ProcessorConfig {

    //Spring默认有个PropertyPlaceholderConfigurer，作为BeanFactoryPostProcessor，在BeanFactory初始化后，用来处理占位符${a.port}
    @Value("${a.port}")
    private String port;

    //init方法，在MyBeanPostProcessor的postProcessBeforeInitialization和postProcessAfterInitialization之间调用
    @Bean(initMethod = "init")
    public ProcessorDao processorDao(){
        return new ProcessorDao();
    }
}
